#!/usr/bin/env bash
#设置前,下下载代码
# sh ~/start/git.sh -i ~/.ssh/gitee/di_home_deploy_id_rsa clone git@gitee.com:alan_jiang/di-home.git

echo "===================即将开始更新di-home=================="

# 进入项目目录
cd /root/MyApp/di-home

# 覆盖本地代码
# 初始化项目获取代码方式:
echo "===================获取代码=================="
sh ~/start/git.sh -i ~/.ssh/gitee/di_home_deploy_id_rsa fetch --all
sh ~/start/git.sh -i ~/.ssh/gitee/di_home_deploy_id_rsa reset --hard origin/master
sh ~/start/git.sh -i ~/.ssh/gitee/di_home_deploy_id_rsa pull

# 安装依赖, 编译
echo "===================安装依赖=================="
npm install

echo "===================编译项目=================="
npm run build


echo "===================Done !=================="
